package com.fesnakj.todos.aop;

import org.apache.log4j.Logger;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.After;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.Pointcut;

@Aspect
public class LoggingAspect {

	private Logger logger = Logger.getLogger(this.getClass());

	@Pointcut("execution(* com.fesnakj.todos.dao.JpaUserDao.findAll(..))")
	public void logging() {
	}

	@Before("logging()")
	public void logBefore() {
		logger.info("Before findAll");
	}

	@After("logging()")
	public void logAfter() {
		logger.info("After findAll");
	}


}
